﻿<%@ Page Language="C#"  MasterPageFile="~/MasterPage.master" AutoEventWireup="true" Inherits="Nivdal.NationalCup" Title="" StylesheetTheme="SkinFile" Codebehind="NationalCup.aspx.cs" %>
<asp:Content ID="PageNameContent" ContentPlaceHolderID="PageNamePlaceHolder" runat="server">
    <asp:Label ID="PageNameLabel" runat="server" Text="<%$ Resources:Resource, NationalCup_PageNameLabel %>" CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    
    <asp:HiddenField ID="LanguageHiddenField" runat="server" />
    <asp:HiddenField ID="CountryIdHiddenField" runat="server" />
    <div class="basic_element">
    <div class="red_title">
        <asp:Label ID="NationalCupTitleLabel" runat="server" Text="<%$ Resources:Resource, NationalCup_PageNameLabel %>" CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">
        <table style="width: 70%;" cellpadding="5" cellspacing="1">
        <tr>
            <td style="text-align:left;">
                <asp:Image ID="CupImage" runat="server" ImageUrl="~/Images/nationalCup.png"/>            
            </td>
            <td style="text-align:left;">
                <asp:Label ID="ChooseSeasonLabel" runat="server" Text='<%# Resources.Resource.Global_ChooseSeason+ ":"%>' SkinID="InfoLabel"></asp:Label>
                <br />
                <asp:DropDownList ID="SeasonDropDownList" runat="server" DataSourceID="SeasonSqlDataSource"
                    DataTextField="SeasonName" DataValueField="Season" AutoPostBack="true" EnableViewState="true"
                    OnSelectedIndexChanged="SeasonDropDownList_SelectedIndexChanged">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SeasonSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="Nivdal_ShowNationalCupSeasonsList" SelectCommandType="StoredProcedure">
                </asp:SqlDataSource>                
            </td>
            <td style="text-align:left;">
                <asp:Label ID="ChooseRoundLabel" runat="server" Text="<%$ Resources:Resource, NationalCup_ChooseRoundLabel %>" Visible="false"
                    EnableViewState="true" SkinID="InfoLabel"></asp:Label>
                <br />
                <asp:DropDownList ID="RoundDropDownList" runat="server" AutoPostBack="true" EnableViewState="true"
                    Visible="false" DataSourceID="RoundSqlDataSource" DataTextField="RoundName" DataValueField="Round"
                    OnSelectedIndexChanged="RoundDropDownList_SelectedIndexChanged">
                </asp:DropDownList>
                <asp:SqlDataSource ID="RoundSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="Nivdal_ShowNationalCupRoundsList" SelectCommandType="StoredProcedure">
                </asp:SqlDataSource>                    
            </td>
        </tr>
        </table>
    <asp:Label ID="ErrorLabel" runat="server" Text="" SkinID="RedSmallHeaderLabel"></asp:Label>
    <asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1">
        <ItemTemplate>
            <asp:Hyperlink ID="TopLeagueNameLinkButton" runat="server" Text='<%# Eval("CountryName") %>'
            NavigateUrl='<%# Eval("CountryId", "Country.aspx?CountryId={0}") %>' SkinID="GreenTitleHyperLink"></asp:Hyperlink>
            &nbsp;&nbsp;&nbsp;
            <asp:ImageButton ID="FlagImageButton" runat="server" ImageUrl='<%# Eval("Flag", "~/Images/Flags/{0}") %>' 
            ToolTip='<%# Eval("CountryName") %>' PostBackUrl='<%# Eval("CountryId", "Country.aspx?CountryId={0}") %>' />
            <table>
                <tr>
                    <td>
                        <asp:Label ID="CountryNameTitleLabel" runat="server" Text='<%# Resources.Resource.Global_Season+ ":"%>' SkinID="InfoLabel"></asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="CountryNameLabel" runat="server" Text='<%# Eval("Season") %>' SkinID="SmallHeaderLabel" />
                    </td>
                </tr>
                
                <tr>
                    <td>
                        <asp:Label ID="ActiveusersTitleLabel" runat="server" Text='<%# Resources.Resource.Global_Round+ ":"%>' SkinID="InfoLabel"></asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="ActiveusersLabel1" runat="server" Text='<%# Eval("Round") %>' SkinID="InfoLabel" />
                    </td>
                </tr>
            </table>
            <asp:Label ID="NumberOfTeamsLabel" runat="server" Text='<%# Eval("TeamsLeft") %>' SkinID="InfoLabel" />
            <br />
            <asp:Label ID="WinnerLabel" runat="server" Text='<%# Resources.Resource.Global_Winner+ ":"%>' Visible='<%# Eval("IsOver") %>'
                SkinID="InfoLabel"></asp:Label>
            <asp:Hyperlink ID="LinkButton1" runat="server" Visible='<%# Eval("IsOver") %>'
            Text='<%# Eval("Winner") %>' NavigateUrl='<%# Eval("WinnerId", "TeamHomePage.aspx?TeamId={0}") %>'
            SkinID="GreenTitleHyperLink"></asp:Hyperlink>
        </ItemTemplate>
    </asp:FormView>
    <br />
    <asp:Label ID="MatchesTitleLabel" runat="server" Text="<%$ Resources:Resource, Global_Match %>" SkinID="InfoLabel"></asp:Label>
    <div class="antifloater">
        <asp:Panel ID="AddToLiveAllPanel" runat="server">
            <asp:Image ID="AddSelectedToLiveImage" ImageUrl="~/Images/Icons/LiveDetails.png" runat="server"        
            AlternateText="Live" ToolTip="<%$ Resources:Resource, Global_AddSelectedMatchesToLive %>" />
            <asp:LinkButton ID="AddSelectedMatchesToLiveButton" runat="server" SkinID="GreenTitleLink"
             Text="<%$ Resources:Resource, Global_AddSelectedMatchesToLive %>" OnClick="AddSelectedToLive"></asp:LinkButton>         
         </asp:Panel>
    </div>
    <asp:GridView ID="GridView1" runat="server" SkinID="Professional" DataSourceID="SqlDataSource2" 
    AutoGenerateColumns="false" OnRowCommand="AddToLive" AllowPaging="true" PageSize="128">
        <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
            Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
        <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
        <Columns>
            <asp:TemplateField HeaderText="<%$ Resources:Resource, Global_Match %>">
                <ItemTemplate>
                    <asp:Hyperlink ID="TopLeagueNameLinkButton" runat="server" Text='<%# Eval("Participants") %>'
                      NavigateUrl='<%# Eval("MatchId", "MatchPage.aspx?MatchId={0}") %>' SkinID="BlackHyperLinkSkin"></asp:Hyperlink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ Resources:Resource, Global_Result %>">
                <ItemTemplate>
                    <asp:Label ID="ActiveusersLabel1" runat="server" Text='<%# Eval("Result") %>' SkinID="GridLabel" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ Resources:Resource, Global_Date %>">
                <ItemTemplate>
                    <asp:Label ID="NumberOfTeamsLabel" runat="server" Text='<%# Eval("MatchDate") %>'
                            SkinID="GridLabel" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:HiddenField ID="MatchIdHiddenField" runat="server" Value='<%# Eval("MatchId") %>' />
                    <asp:ImageButton ID="LiveImageButton" runat="server" Visible='<%# Eval("CanBeAddedToLive") %>' ToolTip="<%$ Resources:Resource, Live_AddMatchToLiveText %>"
                     ImageUrl="~/Images/Icons/LiveDetails.png" CommandName="AddToLive" CommandArgument='<%# Eval("MatchId") %>'/>
                    <asp:CheckBox ID="LiveCheckBox" runat="server" Visible='<%# Eval("CanBeAddedToLive") %>' />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <br />
    <asp:HyperLink ID="NationalCupHistoryHyperLink" runat="server" SkinID="GreenTitleHyperLink"
      Text="<%$ Resources:Resource, NationalCup_NationalCupHistoryHyperLink %>"> </asp:HyperLink>
    </div>
    </div>
    
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="Nivdal_ShowNationalCupInfo" SelectCommandType="StoredProcedure">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="Nivdal_ShowNationalCupRoundMatches" SelectCommandType="StoredProcedure">
    </asp:SqlDataSource>
    </ContentTemplate>
    </asp:UpdatePanel>
    
</asp:Content>
